package org.example.hw.dto.user;

import java.util.Date;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.example.hw.dto.AbstractViewDto;
import org.example.hw.model.User;

public class ViewUserDto extends AbstractViewDto {

	private String username;

	private String firstname;

	private String lastname;

	private String email;

	private Date dateOfBirth;

	public ViewUserDto(User user) {
		this.username = user.getUsername();
		this.firstname = user.getFirstname();
		this.lastname = user.getLastname();
		this.email = user.getEmail();
		this.dateOfBirth = user.getDateOfBirth();
		this.setCreatedBy(user.getCreatedBy());
		this.setModifiedBy(user.getModifiedBy());
		this.setCreationTime(user.getCreationTime());
		this.setModificationTime(user.getModificationTime());
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getFirstname() {
		return firstname;
	}

	public void setFirstname(String firstname) {
		this.firstname = firstname;
	}

	public String getLastname() {
		return lastname;
	}

	public void setLastname(String lastname) {
		this.lastname = lastname;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public Date getDateOfBirth() {
		return dateOfBirth;
	}

	public void setDateOfBirth(Date dateOfBirth) {
		this.dateOfBirth = dateOfBirth;
	}

	@Override
	public String toString() {
		return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).
				append("username", username).
				append("firstname", firstname).
				append("lastname", lastname).
				append("email", email).
				append("dateOfBirth", dateOfBirth).
				append(super.toString()).
				toString();
	}

}
